package com.ccp.dev.form.model;

import com.ccp.dev.core.basic.model.BaseModel;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;

/**
 * PRINT_TEMPLATE Model对象
 *
 * @author chenjing
 */
@XmlRootElement(name = "printTemplates")
@XmlAccessorType(XmlAccessType.NONE)
public class PrintTemplate extends BaseModel
{
	/**
	 * 不是默认版本
	 */
	public static final Short IS_NOT_DEFAULT = 0;

	/**
	 * 是默认版本
	 */
	public static final Short IS_DEFAULT = 1;
	// ID
	@XmlAttribute
	protected String id;
	// FORM_KEY
	@XmlAttribute
	protected String  formKey;
	// TEMPLATE_NAME
	@XmlAttribute
	protected String  templateName;
	// IS_DEFAULT
	@XmlAttribute
	protected Short  isDefault;
	// ALIAS
	@XmlAttribute
	protected String  tableId;
	//模版
	@XmlAttribute
	protected	String template;
	// HTML
	@XmlAttribute
	protected String  html;
	// ALIAS
	@XmlAttribute
	protected String  alias;
	// 是否在流成结束后显示打印按钮 {0:否，1:是}
	@XmlAttribute
	protected Short isPrintInFinish;
	// 是否显示普通表单打印按钮 {0:否，1:是}
	@XmlAttribute
	protected Short isPrintInForm;

	public void setId(String id)
	{
		this.id = id;
	}
	/**
	 * 返回 ID
	 * @return id
	 */
	public String getId()
	{
		return this.id;
	}
	public void setFormKey(String formKey)
	{
		this.formKey = formKey;
	}
	/**
	 * 返回 FORM_KEY
	 * @return formKey
	 */
	public String getFormKey()
	{
		return this.formKey;
	}
	public void setTemplateName(String templateName)
	{
		this.templateName = templateName;
	}


	public String getTemplate() {
		return template;
	}
	public void setTemplate(String template) {
		this.template = template;
	}
	/**
	 * 返回 TEMPLATE_NAME
	 * @return templateName
	 */
	public String getTemplateName()
	{
		return this.templateName;
	}
	public void setIsDefault(Short isDefault)
	{
		this.isDefault = isDefault;
	}
	/**
	 * 返回 IS_DEFAULT
	 * @return isDefault
	 */
	public Short getIsDefault()
	{
		return this.isDefault;
	}

	public String getTableId() {
		return tableId;
	}
	public void setTableId(String tableId) {
		this.tableId = tableId;
	}
	public void setHtml(String html)
	{
		this.html = html;
	}
	/**
	 * 返回 HTML
	 * @return html
	 */
	public String getHtml()
	{
		return this.html;
	}
   	public String getAlias() {
		return alias;
	}
	public void setAlias(String alias) {
		this.alias = alias;
	}
	public Short getIsPrintInFinish() {
		return isPrintInFinish;
	}
	public void setIsPrintInFinish(Short isPrintInFinish) {
		this.isPrintInFinish = isPrintInFinish;
	}
	public Short getIsPrintInForm() {
		return isPrintInForm;
	}
	public void setIsPrintInForm(Short isPrintInForm) {
		this.isPrintInForm = isPrintInForm;
	}
	/**
	 * @see Object#equals(Object)
	 */
	@Override
	public boolean equals(Object object)
	{
		if (!(object instanceof PrintTemplate))
		{
			return false;
		}
		PrintTemplate rhs = (PrintTemplate) object;
		return new EqualsBuilder()
		.append(this.id, rhs.id)
		.append(this.formKey, rhs.formKey)
		.append(this.templateName, rhs.templateName)
		.append(this.isDefault, rhs.isDefault)
		.append(this.tableId, rhs.tableId)
		.append(this.html, rhs.html)
		.isEquals();
	}

	/**
	 * @see Object#hashCode()
	 */
	@Override
	public int hashCode()
	{
		return new HashCodeBuilder(-82280557, -700257973)
		.append(this.id)
		.append(this.formKey)
		.append(this.templateName)
		.append(this.isDefault)
		.append(this.tableId)
		.append(this.html)
		.toHashCode();
	}

	/**
	 * @see Object#toString()
	 */
	@Override
	public String toString() 
	{
		return new ToStringBuilder(this)
		.append("id", this.id) 
		.append("formKey", this.formKey) 
		.append("temapalteName", this.templateName)
		.append("isDefault", this.isDefault) 
		.append("alias", this.tableId) 
		.append("html", this.html) 
		.toString();
	}
   
  

}